﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Anagramme.Contracts.Tests
{
    [TestClass]
    public class WordsValidatorTests
    {
        [TestMethod]
        [ExpectedException(typeof(ArgumentNullException))]
        public void CallValidateMaxWordsLengthWithoutContextThrowException()
        {
            WordsValidator.ValidateMaxWordsLength(1, null);
        }

        [TestMethod]
        [ExpectedException(typeof(ArgumentException))]
        public void CallValidateMaxWordsLengthWithBadContextThrowException()
        {
            ValidationContext context = new ValidationContext(new GameInfo());
            WordsValidator.ValidateMaxWordsLength(1, context);
        }

        [TestMethod]
        [ExpectedException(typeof(ArgumentNullException))]
        public void CallValidateMinWordsLengthWithoutContextThrowException()
        {
            WordsValidator.ValidateMinWordsLength(1, null);
        }

        [TestMethod]
        [ExpectedException(typeof(ArgumentException))]
        public void CallValidateMinWordsLengthWithBadContextThrowException()
        {
            ValidationContext context = new ValidationContext(new GameInfo());
            WordsValidator.ValidateMinWordsLength(1, context);
        }
    }
}
